$(function(){
	$("#saveSendeeInfo").click(function(){
		var sendeeName = $("#sendeeName").val();
		if(!sendeeName){
			eDialog.alert('请填写姓名');
			return;
		}
		var phoneNume = $("#phoneNume").val();
		if(!phoneNume){
			eDialog.alert('请填写号码');
			return;
		}
		if(phoneNume.length!=11){
			eDialog.alert('请填写正确的手机号码');
			return;
		}
		var infoId = $("#infoId").val();
		if(!infoId){
			eDialog.alert('不正常的表单数据');
			return;
		}
		var  groupId = "";
		$("input[name='group']").each(function(){
			if($(this).get(0).checked){
				var ele = $(this).get(0);
				groupId+=$(ele).val()+",";
			}
		});
		$.ajax({
			url: GLOBAL.WEBROOT+"/sendeeInfo/editSendeeInfo",
	        data:{
	        	sendeeName:sendeeName,
	        	phoneNume:phoneNume,
	        	groupId:groupId,
	        	id:infoId,
	        	remark:$("#remark").val()
	        },
	        type:"post",
	        dataType:"json",
	        async:true,
		    cache:true,
	        success: function (data){
	        	window.top.location.href =WEB_ROOT+"/sendeeInfo/init";
	        },
	        error:function(XMLHttpRequest, textStatus, errorThrown){
	        	
	        }
		});
	});
});